package com.xiaozhengkeji.xiaozhengblog.listener;

import com.xiaozhengkeji.xiaozhengblog.events.UserLoginEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class UserListener {
    @EventListener
    @Async
    public void onUserLoginEvent(UserLoginEvent event) {
        log.info("用户登录->" + event.getLoginIp() + "登录状态: " + event.getIsLoginSuccess());
    }
}
